package com.lesson4.factory.pizzastore.order;

import com.lesson4.factory.pizzastore.pizza.CheesePizza;
import com.lesson4.factory.pizzastore.pizza.GreekPizza;
import com.lesson4.factory.pizzastore.pizza.Pizza;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/8/27 14:31
 */
public class SimpleFactory
{
    public Pizza createPizza(String orderType){
        Pizza pizza = null;
        if(orderType.equals("greek")){
            pizza = new GreekPizza();
            pizza.setName("希腊披萨");
        } else if(orderType.equals("cheese")){
            pizza = new CheesePizza();
            pizza.setName("奶酪披萨");
        }
        return pizza;
    }
}
